<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<%@ include file="inc/head.jsp" %>        
    
<title>商品管理</title>
</head>
<body>  
<!--Begin Header Begin-->
<!-- 头部 -->
<%@ include file="inc/head2.jsp" %>
	
<!-- 购物车 -->
<%@ include file="inc/shopping.jsp" %>

<!--End Header End--> 
	<div class="i_bg bg_color">
	
    <div class="m_content">

<!-- 左边 -->
<%@ include file="inc/m_left.jsp" %>

<div class="m_right" id="content">
	<div class="mem_tit">商品列表</div>
	<br>
	<table border="0" class="order_tab" style="width:930px; text-align:center; margin-bottom:30px;" cellspacing="0" cellpadding="0">
		<tbody>
			<tr>
				<td width="10%">商品名称</td>
				<td width="10%">商品图片</td>
				<td width="5%">库存</td>
				<td width="10%">价格</td>
				<td width="10%" colspan="2">操作</td>
			</tr>
			<c:forEach items="${list}" var="item">
				<tr>
					<td style="display: none">${item.id}</td>
					<td>${item.name}</td>
					<td>
						<a href="#" target="_blank">
							<img src="${pageContext.request.contextPath }/files/${item.fileName}" width="50" height="50">
						</a>
					</td>
					<td>${item.stock}</td>
					<td>${item.price}</td>
					<td>
						<a href="Member_GoodUpdate.html">修改</a>
					</td>
					<td>
						<a href="javasctipt:;" onclick="del(${item.id})">删除</a>   
					</td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
	
	<div class="pages">

		<a href="#" class="p_pre">首页</a>

		<a href="#" class="cur">1</a>

		<a href="#">2</a>

		<a href="#">3</a>

		<a href="#">4</a>

		<a href="#" class="p_pre">下一页</a>

		<a href="#" class="p_pre">尾页</a>

	</div>

</div>   
</div>
    
<!-- 脚部 -->
<%@ include file="inc/footer.jsp" %>

</div>
<script type="text/javascript">
		function del(id){
			if(confirm("确认删除吗?")){
				window.location.href="${pageContext.request.contextPath}/DeleteProductInfoServlet?id="+id;
			}
		}
</script>
</body>

</html>
